<style type="text/css" media="all">
@import "../../news/news.css";.STYLE1 {
    font-family:Tahoma;
	font-size:16px;
	font-weight: bold;
	margin-top:15px;
	margin-bottom:15px;
}
.body{
background-color:#CCCCCC}
</style>
<div class="header" >
<?php
     error_reporting(0);
?>
</div>
<?php
	session_start();
	include("../../dbconnect.inc.php");
	$id = $_GET["category"];
	if(!is_numeric($id)&&$id!="") die("idwrong");
	if($id!="") {
		$res = mysql_query("select * from category where id={$id}");
		$row = mysql_fetch_array($res);
		$category_name = $row["category_name"];
	}else {
		$category_name="ALLCATAGORY";
	}

?>
<div class="import2">
  <ul>
   <li style="margin-top:30px; margin-bottom:10px; font-size:24px"><a href="admin_newslist.php"><strong><?php echo $category_name; ?></strong></a></li>
   <?php
	$p = $_GET["p"];
	if($p =="" ) $p=0;
	$start = $p*$PAGE_SIZE;
	$end = $PAGE_SIZE;
	if($id!="") {
		$sql = "select id,title from news where category_id={$id} ";
		$sql .= "order by pubtime desc limit {$start},{$end}";
	}else {
		$sql = "select id,title from news order by pubtime desc limit {$start},{$end}";
	}
	$res = mysql_query($sql);
	if($p==0) {
		$pagelink1 = "frontpage";
	}else {
		$pz = $p-1;
		$pagelink1 = "<a href='admin_newslist.php?category={$id}&p={$pz}'>frontpage</a>";
	}
	if(mysql_num_rows($res) == $PAGE_SIZE) {
		$pz=$p+1;
		$pagelink2 = "<a href='admin_newslist.php?category={$id}&p={$pz}'>nextpage</a>";	
	}else {
		$pagelink2 = "nextpage";	
	}
	
	while($row = mysql_fetch_array($res)) {
?>
    <li><a href="admin_deletenews.php?id=<?php echo $row['id']; ?>" ><?php echo $row['title']; ?></a></li>
	<li class="dotLine"></li>
    <?php
	}
?>
  </ul>
  <br /><?php echo $pagelink1."&nbsp;".$pagelink2; ?>
</div>
</body>
</html>